package com.fin.zw.intelligentbot.entity;

import com.fin.zw.intelligentbot.enums.Sex;
import com.fin.zw.intelligentbot.enums.Status;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;

@Entity
@Table(appliesTo = "user_info",comment="用户信息表")
@Data
public class UserInfo extends BaseEntity{

    @Column(columnDefinition = "varchar(100) COMMENT '用户名称'")
    private String name;

    @Column(columnDefinition = "varchar(20) COMMENT '电话号'")
    private String phone;

    @Column(columnDefinition = "varchar(20) COMMENT '性别'")
    @Enumerated(EnumType.STRING)
    private Sex sex;

    @Column(columnDefinition = "varchar(20) COMMENT '状态'")
    @Enumerated(EnumType.STRING)
    private Status status;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "company_id",columnDefinition = "varchar(64) COMMENT '企业id'")
    private Company company;

    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "account_id",columnDefinition = "varchar(64) COMMENT '账号id'")
    private Account account;

}
